import { Navigate } from 'react-router-dom'
import { RouteObject } from '@/router/interface'
import NotFound from '@/apps/all-in-one/NotFound'
import Elevator from '@/apps/web-games/views/Elevator'
import Practice from '@/apps/web-games/views/Practice'
import Questionnaires from '@/apps/web-games/views/Questionnaires'
import Tetris from '@/apps/web-games/views/Tetris'
// import { ThreeAceWin } from '@/apps/web-games/views/ThreeAceWin'
import ThreeAceWin from '@/apps/web-games/views/ThreeAceWin/ThreeAceWin'
import DiceGame from '@/apps/web-games/views/DiceGame/DiceGame'
import ComponentsCommunication from '@/apps/web-games/views/Practice/ComponentsCommunication'
import NineNineTable from '@/apps/web-games/views/Practice/NineNineTable/NineNineTable'
import NoteBoard from '@/apps/web-games/views/Practice/NoteBoard'
import DiceGameJ from '@/apps/web-games/views/DiceGameJ'
// 尽量少使用自动修补 用也可以，但是得自己看一眼
import WriteQuestionnaires from '@/apps/web-games/views/Questionnaires/WriteQuestionnaires'
import CreateQuestionnaires from '@/apps/web-games/views/Questionnaires/CreateQuestionnaires'
import AddUser from '@/apps/web-games/views/Questionnaires/AddUser'


const WebGameRouter: RouteObject[] = [
	{
		path: '',
		element: <Navigate to='practice-app' />
	},
  {
	  path: 'practice-app', // 这个其实就是父路由
		element: <Practice />,
		meta: {
			requireAuth: true,
			title: 'practice-app',
			key: 'practice-app'
		},
		children: [
			// 例如这样，那么，在进入 practice-app 时，就需要手动指定默认的子路由了
			// 也可以像 bug-manager 那样直接指定,
			{
				path: '',
				element: <Navigate to='components-communication' />
			},
			{
				path: 'components-communication',
				element: <ComponentsCommunication />,
				meta: {
					requireAuth: true,
					title: 'components-communication',
					key: 'components-communication',
				},
			},
			{
				path: 'nine-nine-table',
				element: <NineNineTable />,
				meta: {
					requireAuth: true,
					title: 'nine-nine-tabl',
					key: 'nine-nine-table',
				},
			},
			{
				path: 'noteBoard',
				element: <NoteBoard />,
				meta: {
					requireAuth: true,
					title: 'noteBoard',
					key: 'noteBoard',
				},
			},
			{
				path: 'diceGameJ',
				element: <DiceGameJ />,
				meta: {
					requireAuth: true,
					title: 'diceGameJ',
					key: 'diceGameJ',
				},
			},
		],
	},
  {
	  path: 'elevator-app',
		element: <Elevator />,
		meta: {
			requireAuth: true,
			title: 'elevator-app',
			key: 'elevator-app'
		}
	},
  {
	  path: 'questionnaires-system',
		element: <Questionnaires />,
		meta: {
			requireAuth: true,
			title: 'questionnaires-system',
			key: 'questionnaires-system'
		},
		children: [
			{
				path: '',
				element: <Navigate to='write-questionnaires' />,
			},
			{
				path: 'write-questionnaires',
				element: <WriteQuestionnaires />,
				meta: {
					requireAuth: true,
					title: 'write-questionnaires',
					key: 'write-questionnaires',
				},
			},
			{
				path: 'create-questionnaires',
				element: <CreateQuestionnaires />,
				meta: {
					requireAuth: true,
					title: 'create-questionnaires',
					key: 'create-questionnaires',
				},
			},
			{
				path: 'add-user',
				element: <AddUser />,
				meta: {
					requireAuth: true,
					title: 'add-user',
					key: 'add-user',
				},
			}
		],
	},
  {
	  path: 'tetris-app',
		element: <Tetris />,
		meta: {
			requireAuth: true,
			title: 'tetris-app',
			key: 'tetris-app'
		}
	},
  {
	  path: 'three-ace-win-app',
		element: <ThreeAceWin />,
		meta: {
			requireAuth: true,
			title: 'three-ace-win-app',
			key: 'three-ace-win-app'
		}
	},
  {
	  path: 'dice-app',
		element: <DiceGame />,
		meta: {
			requireAuth: true,
			title: 'dice-app',
			key: 'dice-app'
		}
	},
	{
		path: '*',
		element: <NotFound />,
	}
]
export default WebGameRouter